<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.ncp.model.entity.cart.CartBean"%>
<jsp:useBean id="cart" scope="session" class="com.ncp.model.biz.cart.ShoppingCart"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>确认订单信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="css/common.css" type="text/css" rel="stylesheet" />
	<link href="css/list.css" type="text/css" rel="stylesheet" />
	<link href="css/sure.css" type="text/css" rel="stylesheet" />
	<link rel="stylesheet" type="text/css" href="css/cart.css">
	<script src="js/cart/cart.js" type="text/javascript" charset="UTF-8"></script>
	<style type="text/css">
		.right{ float:right;}
		.title{ color:#65B12D; font-size:16px; line-height:40px;}
		.left{ float:left;}
		.red{ color:#F03;}
	</style>
	<script type="text/javascript">
	function continue1(){
		window.location.href="<%=basePath%>"+"SearchProductServlet?type=all&name=all";
	}
	</script>
  </head>
  
  <body>
<div id="allpage">
	<jsp:include flush="true" page="../index/head.jsp"></jsp:include>
	<div id="main" style="padding:0 20px;width:938px;">
		<div id="position">
			<p>您的位置：<a href="#">首页</a>&emsp;>&emsp;我的购物车</p>
		</div>
		
		<div id="step">
			<ul>
				<li class="left current">1.查看购物车</li>
				<li class="left">2.确认订单信息</li>
				<li class="left">3.付款到支付宝</li>
				<li class="left">4.确认收货</li>
				<li class="left">5.评价</li>
			</ul>
		</div>
		<div style="clear:both"></div>
		
		<div id="display" style="padding:0 20px;">
			<div id="items">
				<p class="title">我的购物车</p>
				<%
    					if(cart.getProductNum()!=0){
    					Map<String,CartBean> cartMap = null;
    					cartMap = cart.getCartMap();
    					CartBean cartBean = null;
    					Iterator<String> hmkey = cartMap.keySet().iterator();
    					while(hmkey.hasNext()){
    						cartBean = cartMap.get(hmkey.next());
    				%>
    		<table style=" border:1px solid #DDD;">
				<tr class="line" style="line-height:26px;">
    				<!-- 显示产品图片 -->
					<td style="border-right:1px solid #DDD; padding:25px;">
						<div class="picture">
							<a href="#">
								<img style="width:120px; height:120px;" src="<%=cartBean.getProductImage() %>"/>
							</a>
						</div>
					</td>
					<td style=" padding:25px; width:200px; overflow:hidden; border-right:1px solid #DDD;">
						<p>
							<!-- 商品名称 -->
							<span class="info_font"><%=cartBean.getProductName() %></span>
							<div style="clear:both"></div>
							<span class="trade_font"></span>
						</p>
						<div style="clear:both"></div>
						<p>
							<span class="gray_font">￥</span>
							<!-- 商品单价 -->
							<span class="red_font"><%=cartBean.getRetailPrice() %></span>
							<span class="gray_font through">￥<%=cartBean.getMarketprice() %></span>
							<div style="clear:both"></div>
							<span class="gray_font">运费0.0</span>
						</p>
						<div style="clear:both"></div>
					</td>
					<td style=" border-right:1px solid #DDD; text-align:center; width:130px; line-height:150px;">0（积分）</td>
					<!-- 商品数量 -->
					<td style=" border-right:1px solid #DDD; text-align:center; width:130px; line-height:150px;"><%=cartBean.getProductNumOfCart() %></td>
					<!-- 该商品价格小计 -->
					<td style=" border-right:1px solid #DDD; text-align:center; width:130px; line-height:150px;"><%=(cartBean.getRetailPrice() * cartBean.getProductNumOfCart())%> 元（价格）</td>
					<td style=" width:130px;">
						<form style="text-align:center;">
							<input type="submit" value="删除" onclick="delProduct('<%=cartBean.getProductID()%>')" style="cursor:pointer;" />
						</form>
					</td>
				</tr>
			</table>
					<%
    					}
    	 			}else{
    	 			%>
    	 				您还没有选择任何商品！
    	 			<%
    	 			}
    	  			%>
				
					<div style="line-height:24px; border-bottom:1px solid #DDD;clear:both;padding:20px 0;">
					<span onclick="emptyCart()" class="left">清空购物车</span>
				<p class="right">商品数量总计：<span class="red"><%=cart.getProductNum() %>件</span>&emsp;&emsp;商品金额总计：<span class="red">￥<%=cart.getTotalprice() %></span></p>
				<%--
					
						<p>数量总计：<%=cart.getProductNum()%></p>
	    	 			<p>商品总价(不含运费)：<%=cart.getTotalprice() %></p>
    	 			--%></div>
    	 			
    	 			<%--<form name="pay_now_form" action="ConfirmOrderServlet" method="post" style="padding:20px 0;">
    	 				<input type="button" value="清空购物车" onclick="emptyCart()" style="cursor:pointer; height:24px;"/>
    	 				<br />
    	 				<input type="submit" name="pay_now" value="结算" style="cursor:pointer; height:24px;" />
    	 			</form>--%>
    	 <form name="pay_now_form" action="ConfirmOrderServlet" method="post">
			<input type="button" onclick="continue1()" value="" style="background:url(images/continue.png) no-repeat; cursor:pointer; width:107px; height:40px; " />
			<input type="submit" value="" style="background:url(images/cal.png) no-repeat; cursor:pointer; width:107px; height:40px;" />
		</form>
    	 			
					<div style=" border-bottom:1px solid #DDD;clear:both"></div>
			</div>
		</div>
	</div>
	
	<div id="slice">
	</div>
	
	<jsp:include flush="true" page="../index/foot.jsp"></jsp:include>
	
</div>

</body>
</html>
